#pragma once
#include "CameraBase.hxx"

namespace Eifersucht
{
	class FirstPersonCamera : public BasicCamera
	{

#pragma region Properties
	public:

		inline Float32x4ConstPtr GetWorldRight() { return (Float32x4Ptr)&m_f4x4World.m[0]; }
		inline Float32x4ConstPtr GetWorldAhead() { return (Float32x4Ptr)&m_f4x4World.m[2]; }
		inline Float32x4ConstPtr GetWorldEye() { return (Float32x4Ptr)&m_f4x4World.m[3]; }
		inline Float32x4ConstPtr GetWorldUp() { return (Float32x4Ptr)&m_f4x4World.m[1]; }
		inline Float32x4x4Ptr GetWorld() { return &m_f4x4World; }

		inline Void SetRotateButtons( 
			_In_ Bool bLeft, _In_ Bool bMiddle, _In_ Bool bRight, 
			_In_ Bool bRotateWithoutPress 
			)
		{
			m_iActiveButtonMask = ( bLeft ? _To_int BasicCamera::PointerButton::Left : NULL ) | 
				( bMiddle ? _To_int BasicCamera::PointerButton::Middle : NULL ) | 
				( bRight ? _To_int BasicCamera::PointerButton::Right : NULL );
			m_bRotateWithoutPress = bRotateWithoutPress;

		}

#pragma endregion Properties

#pragma region Members
	protected:

		Float32x4x4 m_f4x4World;		// Camera world matrix (inverse view).
		Int32 m_iActiveButtonMask;		// Indicates with buttons are enabled for rotation.
		Bool m_bRotateWithoutPress;		// Indicates whether to rotate camera without active button pressed.

#pragma endregion Members

	public:

		FirstPersonCamera();

		Void OnFrameMove( _In_ Float32 fElapsed );
	};
};